package org.phantom.securityframework.local;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.phantom.securityframework.api.Permission;
import org.phantom.securityframework.api.Resource;
import org.phantom.securityframework.api.ResourceManager;
import org.springframework.stereotype.Service;


@Service
public class ResourceManagerLocalImpl implements ResourceManager{

	@javax.annotation.Resource
	private SqlSession session = null;
	@Override
	public void add(Resource resource) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void addAll(Resource[] resources) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<Resource> list() {
		// TODO Auto-generated method stub
		return null;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Permission> getAllPermission(Resource resource) {
		return session.selectList("org.phantom.securityframework.ResourceMapper.listPermissions",resource.getId());
	}

	@Override
	public Resource get(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Resource get(String res) {
		// TODO Auto-generated method stub
		return null;
	}

}